package org.jingouzhui.domain.strategy.service.rule.tree;

import lombok.extern.slf4j.Slf4j;
import org.jingouzhui.domain.strategy.model.valboj.RuleLogicCheckTypeVO;
import org.jingouzhui.domain.strategy.service.rule.tree.factory.DefaultTreeFactory;
import org.springframework.stereotype.Component;

/**
 * @description: 幸运奖兜底规则树节点
 * @author: jingouzhui
 * @date: 2025/5/1 16:44
 */
@Slf4j
@Component("rule_luck_award")
public class RuleLuckAwardLogicTreeNode implements ILogicTreeNode{
    @Override
    public DefaultTreeFactory.TreeActionEntity logic(String userId, Long strategyId, Integer awardId,String ruleValue) {
        log.info("规则树-幸运奖兜底流程开始,userId:{},strategyId:{},awardId:{}",userId,strategyId,awardId);
        return DefaultTreeFactory.TreeActionEntity.builder()
                .ruleLogicCheckTypeVO(RuleLogicCheckTypeVO.TAKE_OVER)
                .strategyAwardVO(DefaultTreeFactory.StrategyAwardVO.builder()
                        .awardId(awardId)
                        .awardRuleValue(ruleValue)
                        .build())
                .build();
    }
}
